
import connexiondb.connexiondb;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author HP
 */
public class GestionMedi extends javax.swing.JFrame {
connexiondb db ;
  public static ResultSet rs ;
   public static ResultSet rs1 ;
    /**
     * Creates new form GestionMedi
     */
  DefaultTableModel _modelT = null;
    DefaultComboBoxModel _model = null;
    
    public GestionMedi() {
        initComponents();
          db = new connexiondb();
        loader();
        Reinstialise();
    }
public void Reinstialise() {
        codeMed.setText("");        
        nomMed.setText("");
        
        dosageMed.setText("");
        qte.setText("");
        prixunitMed.setText("");
        posologieMed.setText("");
        obsMed.setText("");
        codeMed.requestFocus();
    }
 public void loader() {
        try {
           rs= db.getDataBase("SELECT `code`, `designation` FROM `typemedicament`");
//            req = "SELECT `code`, `designation` FROM `typemedicament`";
//            rs = s.executeQuery(req);
            _model = new DefaultComboBoxModel();
            while (rs.next()) {
                _model.addElement(rs.getString(1));
            }
            c2.setModel(_model);
            
            
            
            
            String r="SELECT codemedicament,designation,libelle,dosage,qte,prixvente,posologie,observation From typemedicament,medicament WHERE typemedicament.code = medicament.code";
 
       rs =  db.getDataBase(r);
            
            _modelT = new DefaultTableModel();
            _modelT.addColumn("CODE DU MEDICAMENT");
            _modelT.addColumn("NOM DU  FAMILLE");
            _modelT.addColumn("NOM DU MEDICAMENT");
            _modelT.addColumn("DOSAGE");
            _modelT.addColumn("QUANTITE");
            _modelT.addColumn("PRIX UNITAIRE");
            _modelT.addColumn("POSOLOGIE");
            _modelT.addColumn("OBSERVATIONS");
            while (  rs.next()) {
                 
                Vector row = new Vector<>();
                row.add(rs.getString(1));
                row.add(rs.getString(2));
                row.add(rs.getString(3));
                row.add(rs.getString(4));
                row.add(rs.getString(5));
                row.add(rs.getString(6));
                row.add(rs.getString(7));
                row.add(rs.getString(8));
                nomMed.setText(rs.getString(3));
                dosageMed.setText(rs.getString(4));
                qte.setText(rs.getString(5));
                prixunitMed.setText(rs.getString(6));
                posologieMed.setText(rs.getString(7));
                obsMed.setText(rs.getString(7));
                c2.setSelectedItem(rs.getString(2));
                _modelT.addRow(row);
            }
            jTable1.setModel(_modelT);
        } catch (SQLException ex) {
            Logger.getLogger(GestionMedi.class.getName()).log(Level.SEVERE, null, ex);
        }}
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        try {
            jPanel2 =(javax.swing.JPanel)java.beans.Beans.instantiate(getClass().getClassLoader(), "GestionMedi_jPanel2");
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (java.io.IOException e) {
            e.printStackTrace();
        }
        jLabel2 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        c2 = new javax.swing.JComboBox();
        dosageMed = new javax.swing.JTextField();
        nomMed = new javax.swing.JTextField();
        prixunitMed = new javax.swing.JTextField();
        qte = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        codeMed = new javax.swing.JTextField();
        obsMed = new javax.swing.JTextField();
        posologieMed = new javax.swing.JTextField();
        bannuler = new javax.swing.JButton();
        bfermer = new javax.swing.JButton();
        jLabel5 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        supprimer = new javax.swing.JButton();
        bajouter4 = new javax.swing.JButton();
        modifier = new javax.swing.JButton();
        rechercher = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jLabel11 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Gestion Medicament");
        setMinimumSize(new java.awt.Dimension(500, 300));
        getContentPane().setLayout(null);

        jPanel2.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel2.setBackground(new java.awt.Color(51, 0, 204));
        jLabel2.setFont(new java.awt.Font("Comic Sans MS", 1, 14)); // NOI18N
        jLabel2.setForeground(new java.awt.Color(0, 102, 0));
        jLabel2.setText("NOM DE MEDICAMENT  :");
        jPanel2.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 40, 245, -1));

        jLabel6.setFont(new java.awt.Font("Comic Sans MS", 1, 14)); // NOI18N
        jLabel6.setForeground(new java.awt.Color(0, 102, 0));
        jLabel6.setText("NOMBRE DE MEDICAMENT  :");
        jPanel2.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 140, -1, 20));

        jLabel7.setBackground(new java.awt.Color(51, 0, 204));
        jLabel7.setFont(new java.awt.Font("Comic Sans MS", 1, 14)); // NOI18N
        jLabel7.setForeground(new java.awt.Color(0, 102, 0));
        jLabel7.setText("DOSAGE DE MEDICAMENT  :");
        jPanel2.add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 100, -1, 20));

        jLabel8.setFont(new java.awt.Font("Comic Sans MS", 1, 14)); // NOI18N
        jLabel8.setForeground(new java.awt.Color(0, 102, 0));
        jLabel8.setText("FAMILLE DE MEDICAMENT  :");
        jPanel2.add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 70, -1, 20));

        jLabel9.setFont(new java.awt.Font("Comic Sans MS", 1, 14)); // NOI18N
        jLabel9.setForeground(new java.awt.Color(0, 102, 0));
        jLabel9.setText("PRIX UNITAIRE :");
        jPanel2.add(jLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(520, 20, -1, -1));

        c2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { " " }));
        c2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                c2ActionPerformed(evt);
            }
        });
        jPanel2.add(c2, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 70, 230, -1));
        jPanel2.add(dosageMed, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 100, 230, -1));
        jPanel2.add(nomMed, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 40, 230, -1));
        jPanel2.add(prixunitMed, new org.netbeans.lib.awtextra.AbsoluteConstraints(700, 20, 210, 30));
        jPanel2.add(qte, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 140, 230, -1));

        jLabel4.setFont(new java.awt.Font("Comic Sans MS", 1, 14)); // NOI18N
        jLabel4.setForeground(new java.awt.Color(0, 102, 0));
        jLabel4.setText("POSOLOGIE USUELLE  :");
        jPanel2.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(510, 70, -1, 30));

        codeMed.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                codeMedActionPerformed(evt);
            }
        });
        jPanel2.add(codeMed, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 10, 233, -1));
        jPanel2.add(obsMed, new org.netbeans.lib.awtextra.AbsoluteConstraints(700, 140, 210, 40));

        posologieMed.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                posologieMedActionPerformed(evt);
            }
        });
        jPanel2.add(posologieMed, new org.netbeans.lib.awtextra.AbsoluteConstraints(700, 70, 210, 40));

        bannuler.setFont(new java.awt.Font("Comic Sans MS", 1, 15)); // NOI18N
        bannuler.setForeground(new java.awt.Color(0, 102, 0));
        bannuler.setIcon(new javax.swing.ImageIcon(getClass().getResource("/image/user-reset.png"))); // NOI18N
        bannuler.setText("Réinitialiser");
        bannuler.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bannulerActionPerformed(evt);
            }
        });
        jPanel2.add(bannuler, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 180, 180, 30));

        bfermer.setFont(new java.awt.Font("Comic Sans MS", 1, 15)); // NOI18N
        bfermer.setForeground(new java.awt.Color(0, 102, 0));
        bfermer.setIcon(new javax.swing.ImageIcon(getClass().getResource("/image/bouton_fermer.png"))); // NOI18N
        bfermer.setText("Fermer");
        bfermer.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bfermerActionPerformed(evt);
            }
        });
        jPanel2.add(bfermer, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 180, 170, 30));

        jLabel5.setFont(new java.awt.Font("Comic Sans MS", 1, 14)); // NOI18N
        jLabel5.setForeground(new java.awt.Color(0, 102, 0));
        jLabel5.setText("OBSERVATIONS  :");
        jPanel2.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(530, 150, -1, -1));

        jLabel3.setBackground(new java.awt.Color(0, 51, 204));
        jLabel3.setFont(new java.awt.Font("Comic Sans MS", 1, 14)); // NOI18N
        jLabel3.setForeground(new java.awt.Color(0, 102, 0));
        jLabel3.setText("Code DE MEDICAMENT  :");
        jPanel2.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, 245, 20));

        getContentPane().add(jPanel2);
        jPanel2.setBounds(73, 130, 990, 228);

        jPanel1.setBackground(new java.awt.Color(204, 204, 204));
        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Les Opérations :", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Comic Sans MS", 1, 15), new java.awt.Color(0, 102, 0))); // NOI18N

        supprimer.setFont(new java.awt.Font("Comic Sans MS", 1, 15)); // NOI18N
        supprimer.setForeground(new java.awt.Color(0, 102, 0));
        supprimer.setIcon(new javax.swing.ImageIcon(getClass().getResource("/image/overview_button_delete.gif"))); // NOI18N
        supprimer.setText("Supprimer");
        supprimer.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                supprimerActionPerformed(evt);
            }
        });

        bajouter4.setFont(new java.awt.Font("Comic Sans MS", 1, 15)); // NOI18N
        bajouter4.setForeground(new java.awt.Color(0, 102, 0));
        bajouter4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/image/enr.gif"))); // NOI18N
        bajouter4.setText("Ajouter");
        bajouter4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bajouter4ActionPerformed(evt);
            }
        });

        modifier.setFont(new java.awt.Font("Comic Sans MS", 1, 15)); // NOI18N
        modifier.setForeground(new java.awt.Color(0, 102, 0));
        modifier.setIcon(new javax.swing.ImageIcon(getClass().getResource("/image/icone_modifier.gif"))); // NOI18N
        modifier.setText("Modifier");
        modifier.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                modifierActionPerformed(evt);
            }
        });

        rechercher.setFont(new java.awt.Font("Comic Sans MS", 1, 15)); // NOI18N
        rechercher.setForeground(new java.awt.Color(0, 102, 0));
        rechercher.setIcon(new javax.swing.ImageIcon(getClass().getResource("/image/noloc_env_search_icon.gif"))); // NOI18N
        rechercher.setText("Rechercher");
        rechercher.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rechercherActionPerformed(evt);
            }
        });

        jButton2.setFont(new java.awt.Font("Comic Sans MS", 1, 15)); // NOI18N
        jButton2.setForeground(new java.awt.Color(0, 102, 0));
        jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/image/images.jpg"))); // NOI18N
        jButton2.setText("Afficher");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(23, 23, 23)
                .addComponent(bajouter4, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(59, 59, 59)
                .addComponent(modifier)
                .addGap(57, 57, 57)
                .addComponent(supprimer)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 102, Short.MAX_VALUE)
                .addComponent(rechercher)
                .addGap(55, 55, 55)
                .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton2)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(bajouter4, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(modifier)
                        .addComponent(supprimer)
                        .addComponent(rechercher)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        getContentPane().add(jPanel1);
        jPanel1.setBounds(73, 43, 990, 81);

        jLabel1.setFont(new java.awt.Font("Comic Sans MS", 1, 24)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(255, 255, 255));
        jLabel1.setText("Gestion Des Médicaments");
        getContentPane().add(jLabel1);
        jLabel1.setBounds(420, 10, 360, 26);

        jLabel10.setFont(new java.awt.Font("Comic Sans MS", 1, 16)); // NOI18N
        jLabel10.setForeground(new java.awt.Color(255, 255, 255));
        jLabel10.setText("Liste Des Médicaments :");
        getContentPane().add(jLabel10);
        jLabel10.setBounds(70, 360, 240, 20);

        jTable1.setFont(new java.awt.Font("Comic Sans MS", 1, 15)); // NOI18N
        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {},
                {},
                {},
                {},
                {},
                {},
                {},
                {},
                {},
                {},
                {},
                {},
                {},
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        jScrollPane1.setViewportView(jTable1);

        getContentPane().add(jScrollPane1);
        jScrollPane1.setBounds(70, 390, 990, 100);

        jLabel11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/image/d8e8c57e4c07ddfdbe387271e2930732_large.jpeg"))); // NOI18N
        jLabel11.setText("jLabel11");
        jLabel11.setToolTipText("");
        getContentPane().add(jLabel11);
        jLabel11.setBounds(-290, 0, 1550, 580);

        setSize(new java.awt.Dimension(1179, 554));
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents
 
    private void codeMedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_codeMedActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_codeMedActionPerformed

    private void bannulerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bannulerActionPerformed
        Reinstialise();
    }//GEN-LAST:event_bannulerActionPerformed

    private void bfermerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bfermerActionPerformed
         fenetredemarrage fen = new fenetredemarrage();
            fen.setVisible(true);
            this.setVisible(false);
    }//GEN-LAST:event_bfermerActionPerformed

    private void supprimerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_supprimerActionPerformed
        if (!codeMed.getText().equals("")) {
            try {
                String i = "delete from medicament where codemedicament='" + codeMed.getText() + "'";
                int a=
                db.setDataBase(i);
                Reinstialise();
                loader();
                if(a==1)
                JOptionPane.showMessageDialog(null, "suppression par succee");
            } catch (Exception e) {
                JOptionPane.showMessageDialog(null, e.getMessage());
            }
        } else {
            JOptionPane.showMessageDialog(null, "chercher l' element a modifier");
        }
    }//GEN-LAST:event_supprimerActionPerformed

    private void bajouter4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bajouter4ActionPerformed
        try {
            // req = "insert into medicament(`codemedicament`, `code`, `libelle`, `dosage`, `qte`, `prixvente`, `posologie`, `observation`) "
            //   + "            VALUES ('" + codeMed.getText() + "','" + c2.getSelectedItem().toString() + "','" + nomMed.getText() + "','" + dosageMed.getText() + "','" + Integer.valueOf(qte.getText()) + "','" + Double.valueOf(prixunitMed.getText()) + "','" + posologieMed.getText() + "','" + obsMed.getText() + "')";

            String   q = "insert into medicament values('" + codeMed.getText() + "','" + c2.getSelectedItem().toString() + "','" + nomMed.getText() + "','" + dosageMed.getText() + "','" + Integer.valueOf(qte.getText()) + "','" + Double.valueOf(prixunitMed.getText()) + "','" + posologieMed.getText() + "','" + obsMed.getText() + "')";
            int a=
            db.setDataBase(q);

            Reinstialise();
            loader();
            if(a==1)
            JOptionPane.showMessageDialog(null, "ajout par succee");
            Reinstialise();
        } catch (Exception e) {
            JOptionPane.showMessageDialog(null, e.getMessage());
        }
    }//GEN-LAST:event_bajouter4ActionPerformed

    private void modifierActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_modifierActionPerformed
        if (!codeMed.getText().equals("")) {
            try {
                String f = "update medicament set code='" + c2.getSelectedItem().toString() + "',libelle='" + nomMed.getText() + "',dosage='" + dosageMed.getText() + "',qte=qte+" + Integer.valueOf(qte.getText()) + ",prixvente='" + Double.valueOf(prixunitMed.getText()) + "',posologie='" + posologieMed.getText() + "',observation='" + obsMed.getText() + "' where codemedicament='" + codeMed.getText() + "'";
                int a=
                db.setDataBase(f);

                Reinstialise();
                loader();
                if(a==1)
                JOptionPane.showMessageDialog(null, "modification par succee");
            } catch (Exception e) {

                JOptionPane.showMessageDialog(null, e.getMessage());
            }
        } else {
            JOptionPane.showMessageDialog(null, "chercher l' element a modifier");
        }
    }//GEN-LAST:event_modifierActionPerformed

    private void rechercherActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rechercherActionPerformed
        try {

            String d = "SELECT  `codemedicament` ,  `code` , (\n"
            + "\n"
            + "SELECT designation\n"
            + "FROM typemedicament\n"
            + "WHERE code = medicament.code\n"
            + "),  `libelle` ,  `dosage` ,  `qte` ,  `prixvente` ,  `posologie` ,  `observation` \n"
            + "FROM  `medicament`  where`codemedicament` Like '" + codeMed.getText() + "'";
            // db.IDQuery(d);
            rs=db.getDataBase(d);
            _modelT.setNumRows(0);
            if (rs.next()) {
                Vector row = new Vector<>();
                row.add(rs.getString(1));
                row.add(rs.getString(3));
                row.add(rs.getString(4));
                row.add(rs.getString(5));
                row.add(rs.getString(6));
                row.add(rs.getString(7));
                row.add(rs.getString(8));
                row.add(rs.getString(9));
                nomMed.setText(rs.getString(4));
                dosageMed.setText(rs.getString(5));
                qte.setText(rs.getString(6));
                prixunitMed.setText(rs.getString(7));
                posologieMed.setText(rs.getString(8));
                obsMed.setText(rs.getString(9));
                c2.setSelectedItem(rs.getString(2));
                _modelT.addRow(row);
            }

        } catch (Exception e) {
        }
    }//GEN-LAST:event_rechercherActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
         if(_modelT.getRowCount()!=0) _modelT.setNumRows(0);
       else loader();
    }//GEN-LAST:event_jButton2ActionPerformed

    private void c2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_c2ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_c2ActionPerformed

    private void posologieMedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_posologieMedActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_posologieMedActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
         java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new GestionMedi().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton bajouter4;
    private javax.swing.JButton bannuler;
    private javax.swing.JButton bfermer;
    private javax.swing.JComboBox c2;
    private javax.swing.JTextField codeMed;
    private javax.swing.JTextField dosageMed;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable jTable1;
    private javax.swing.JButton modifier;
    private javax.swing.JTextField nomMed;
    private javax.swing.JTextField obsMed;
    private javax.swing.JTextField posologieMed;
    private javax.swing.JTextField prixunitMed;
    private javax.swing.JTextField qte;
    private javax.swing.JButton rechercher;
    private javax.swing.JButton supprimer;
    // End of variables declaration//GEN-END:variables

  
}
